package com.example.bilibili_miaosha.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @ClassName ValidatorUtil
 * @Description 检验手机号
 * @Author 川
 * @Date 2022/3/28 10:57
 * @Version 1.0
 **/
public class ValidatorUtil {
    private final static Pattern mobile_pattern = Pattern.compile("^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\\d{8}$");
    public static boolean isMobile(String mobile){
        if (mobile.isEmpty()) return false;
        Matcher matcher = mobile_pattern.matcher(mobile);
        return matcher.matches();
    }
}
